/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-10-22
 * Time: 20:55
 */
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String version1 = sc.next();
        String version2 = sc.next();
        String[] v1 = version1.split("\\.");
        String[] v2 = version2.split("\\.");

        VersionCode vv1 = new VersionCode(v1[0], v1[1], v1[2]);
        VersionCode vv2 = new VersionCode();
        vv2.setMajor(v2[0]);
        vv2.setMinor(v2[1]);
        vv2.setRevision(v2[2]);
        System.out.println(vv1.compare(vv2));
    }
}
class VersionCode{
    int major;
    int minor;
    int revision;
    public VersionCode(){
        this.major=0;
        this.minor=0;
        this.revision=0;
    }
    public VersionCode(String major, String minor, String revision){
        this.major=Integer.parseInt(major);
        this.minor=Integer.parseInt(minor);
        this.revision=Integer.parseInt(revision);
    }
    public void setMajor(String major){
        this.major=Integer.parseInt(major);
    }
    public void setMinor(String minor){
        this.minor=Integer.parseInt(minor);
    }
    public void setRevision(String revision){
        this.revision=Integer.parseInt(revision);
    }
    public int compare(VersionCode anotherCode){
        if(major==anotherCode.major){
            if(minor==anotherCode.minor){
                if(revision==anotherCode.revision){
                    return 0;
                }else{
                    return compare2(revision,anotherCode.revision);
                }
            }else{
                return compare2(minor,anotherCode.minor);
            }
        }else{
            return compare2(major,anotherCode.major);
        }
    }
    public int compare2(int s1,int s2){
        if(s1<s2){
            return -1;
        }else{
            return 1;
        }
    }
}